home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD001b.dsk
/
SUPER.RAT.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
3KB
|
83 lines
1 REM SUPER.RAT READS APPLE TEXT
10 D$ = CHR$(4):Z = 0:W = 1:BF = 256:SB = 255:RL = Z:RN = Z:PH = Z
15 PRINT D$"CLOSE": PRINT D$"PR#0"
20 HM = PEEK(115) +256 * PEEK(116)
21 HOME : VTAB 3: PRINT "SUPER.RAT READS APPLE TEXT FILES"
23 PRINT : PRINT "IT'S OK TO HIT RESET ANYTIME."
24 PRINT : PRINT "IF YOU ENTER THE NAME OF A FILE"
25 PRINT "THAT DOES NOT EXIST ---": PRINT
26 HTAB 10: PRINT "SUPER.RAT CREATES AN EMPTY"
27 HTAB 10: PRINT "FILE BY THAT NAME"
28 PRINT : PRINT "IT'S UP TO YOU TO DELETE IT."
30 PRINT : INPUT "ENTER FILE NAME ";NF$: PRINT
31 INPUT "S=SEQUENTIAL R=RANDOM (S OR R)? ";R$: PRINT
32 IF R$ = "S" GOTO 500
33 IF R$ = "R" GOTO 35
34 VTAB ( PEEK(37)): CALL -868: GOTO 31
35 INPUT "DO YOU KNOW RECORD LENGTH (Y OR N)? ";R$
36 IF R$ = "N" GOTO 50
37 IF R$ = "Y" GOTO 40
38 VTAB ( PEEK(37)): CALL -868: GOTO 35
40 PRINT
41 INPUT "ENTER RECORD LENGTH ";RL
42 RL = INT( ABS(RL)): PRINT : GOTO 311
50 HOME : VTAB 8: PRINT "PARDON ME WHILE I DETERMINE REC LENGTH": PRINT : PRINT "IF YOUR ZERO RECORD IS FULL"
51 PRINT " OR": PRINT "RECORD NUMBER ONE IS EMPTY": PRINT : PRINT " SUPER.RAT COMES UP WITH THE WRONG": HTAB 25: PRINT "RECORD LENGTH."
52 PRINT : PRINT "RESET ME IF I SEEM TO BE IN A LOOP"
60 PRINT D$"OPEN "NF$",L256"
62 FOR I = W TO BF: POKE HM -W +I,Z: NEXT
64 PRINT D$"READ "NF$",R"RN
70 ONERR GOTO 1000
75 ES = Z
80 IF ES = Z THEN INPUT A$
90 POKE 216,Z:BL = Z
95 IF PH = 1 GOTO 200
110 IF PEEK(HM +BL) = Z GOTO 195
120 BL = BL +W: IF BL >SB GOTO 150
140 GOTO 110
150 RL = RL +BF:RN = RN +W: GOTO 60
195 PH = W
200 IF PEEK(HM +BL) < >Z GOTO 310
210 BL = BL +W: IF BL >SB GOTO 150
230 GOTO 200
310 RL = RL +BL: PRINT : PRINT : PRINT "REC LENGTH = ";RL:RN = -W: PRINT D$"CLOSE": PRINT
311 RN = Z: INPUT "WANT TO START AT RECORD ZERO (Y OR N)? ";R$
312 IF R$ = "Y" GOTO 316
313 IF R$ = "N" GOTO 315
314 VTAB ( PEEK(37)): CALL -868: GOTO 311
315 PRINT : INPUT "ENTER STARTING RECORD NUMBER ";RN
316 RN = INT( ABS(RN)) -W: PRINT
317 INPUT "P=PRINTER S=SCREEN (P OR S)? ";PS$
318 IF PS$ = "S" GOTO 325
319 IF PS$ = "P" GOTO 321
320 VTAB ( PEEK(37)): CALL -868: GOTO 317
321 PRINT D$"PR#1": PRINT
325 HOME : PRINT NF$;" REC LENGTH = ";RL: PRINT "====================="
330 PRINT D$"OPEN "NF$",L"RL
335 RN = RN +W: PRINT "---- REC NBR ";RN;
336 IF PS$ = "S" GOTO 338
337 PRINT : GOTO 350
338 INPUT " HIT RETURN OR RESET";R$
350 PRINT D$"READ "NF$",R"RN:BR = Z
360 ONERR GOTO 1000
365 ES = Z
370 IF ES = Z THEN INPUT A$
380 IF ES = W GOTO 330
385 INVERSE : PRINT A$: NORMAL
390 BR = BR + LEN(A$) +W: IF BR <RL GOTO 370
400 GOTO 335
500 PRINT D$"OPEN "NF$
520 PRINT
530 INPUT "P=PRINTER S=SCREEN (P OR S)? ";PS$
540 IF PS$ = "S" GOTO 575
550 IF PS$ = "P" GOTO 570
560 VTAB ( PEEK(37)): CALL -868: GOTO 530
570 PRINT D$"PR#1": PRINT
575 HOME : PRINT NF$: PRINT "================"
590 PRINT D$"READ "NF$: ONERR GOTO 8999
600 INPUT A$: INVERSE : PRINT A$: NORMAL : GOTO 600
1000 IF PEEK(222) < >5 GOTO 9000
1010 ES = W: RESUME
8999 IF PEEK(222) = 5 GOTO 9500
9000 PRINT "ERR NBR "; PEEK(222)
9500 PRINT D$"CLOSE": PRINT D$"PR#0": END